package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.ClassificationDAO;
import cn.nebula.music.domain.Classification;

@Component
public class StringToClassificationConverter implements Converter<String,Classification>{

	@Autowired
	private ClassificationDAO classificationDAO;

	@Override
	public Classification convert(String source) {
		return classificationDAO.findClassificationById(Integer.valueOf(source));
	}
	
	
}
